@extends('layouts.main')



@section('content')
    <div>
        <h2>订单信息</h2>
        <p>
            <span>总价:</span> <span>￥{{$order->totalprice}}</span>
        </p>
        <p>
            <span>下单时间</span> <span>{{$order->time}}</span>
        </p>
    </div>
    <div>
        <h2> 支付信息 </h2>
        <div>
            <ul class="nav nav-tabs" role="tablist">
                <li role="presentation" class="active">
                    <a href="#home" aria-controls="home" role="tab" data-toggle="tab">微信支付</a>
                </li>
                <li role="presentation">
                    <a href="#profile" aria-controls="profile" role="tab" data-toggle="tab">支付宝</a>
                </li>
                <li role="presentation">
                    <a href="#messages" aria-controls="messages" role="tab" data-toggle="tab">网银</a>
                </li>
                <li role="presentation">
                    <a href="#settings" aria-controls="settings" role="tab" data-toggle="tab">线下汇款</a>
                </li>
            </ul>
            <div class="tab-content">
                <div role="tabpanel" class="tab-pane active" id="home">
                    <img src="/pic/weixin.jpg" alt="" width="250" height="250">
                </div>
                <div role="tabpanel" class="tab-pane" id="profile">
                    <img src="/pic/weixin.jpg" alt="" width="250" height="250">
                </div>
                <div role="tabpanel" class="tab-pane" id="messages">
                    <button>建设银行</button>
                    <button>工商银行</button>
                    <button>交通银行</button>
                </div>
                <div role="tabpanel" class="tab-pane" id="settings"><p>请汇款至：62220231000086541575 <span>xxx</span></p>
                </div>
            </div>

        </div>
        <div>
            <button class="btn btn-success lg pay-btn">我已支付完成</button>
        </div>
    </div>
@endsection

@section('scripts')
    <script>
        $('.pay-btn').click(function () {
            let order_id = '{{$order->order_id??0}}';
            $.post('{{route('order.pay')}}', {
                order_id: order_id
            }, function (res) {
                location.href = '{{route('order.show',['order_id'=>$order->order_id])}}';
            })
        });

    </script>
@endsection
